How to Export Item wise Name,Closing stock,Value and Price from tally using XML TAGS via http
<ENVELOPE>
<HEADER>
<VERSION>1</VERSION>
<TALLYREQUEST>Export</TALLYREQUEST>
<TYPE>Collection</TYPE>
<ID>All items under Groups</ID>
</HEADER>
<BODY>
<DESC>
<STATICVARIABLES>
<SVCURRENTCOMPANY>company</SVCURRENTCOMPANY>
<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>
</STATICVARIABLES>
<TDL>
<TDLMESSAGE>
<COLLECTION NAME="All items under Groups" ISMODIFY="No">
<TYPE>stock item</TYPE>
<FETCH>Name,Parent,BaseUnits,ClosingBalance,ClosingRate,
ClosingValue,FULLPRICELIST</FETCH>
</COLLECTION>
</TDLMESSAGE>
</TDL>
</DESC>
</BODY>
</ENVELOPE>
How to Export data from tally using php?
<?php
$requestXML = '<ENVELOPE>'.
'<HEADER>'.
'<TALLYREQUEST>Export Data</TALLYREQUEST>'.
'</HEADER>'.
'<BODY>'.
'<EXPORTDATA>'.
'<REQUESTDESC>'.
'<REPORTNAME>Daybook</REPORTNAME>'.
'<STATICVARIABLES>'.
'<SVEXPORTFORMAT>$$SysName:XML</SVEXPORTFORMAT>'.
'</STATICVARIABLES>'.
'</REQUESTDESC>'.
'</EXPORTDATA>'.
'</BODY>'.
'</ENVELOPE>';
Let us consider different scenarios to understand the Request and Response XML structure.
Export - Request to Export Data and Corresponding response.
Import - Request to Import Data and the Corresponding response.
Execute - Request to Execute Action and Corresponding response.
XML Response received From Tally
<BODY> contains the following
<ENVELOPE>
<HEADER>
<TALLYREQUEST>Import Data</TALLYREQUEST>
</HEADER>
<BODY>
<IMPORTDATA>
<REQUESTDESC>
<REPORTNAME>All Masters</REPORTNAME>
<STATICVARIABLES>
<SVCURRENTCOMPANY>company</SVCURRENTCOMPANY>
</STATICVARIABLES>
</REQUESTDESC>
<REQUESTDATA>
<TALLYMESSAGE xmlns:UDF="TallyUDF">
<VOUCHER VCHTYPE="Sales Order" ACTION="Create">
<DATE>#fromdate</DATE>
<PARTYNAME>CustomerName</PARTYNAME>
<VOUCHERTYPENAME>Sales Order</VOUCHERTYPENAME>
<VOUCHERNUMBER>4</VOUCHERNUMBER>
<REFERENCE>14</REFERENCE>
<PARTYLEDGERNAME>A.R.AUTO PARTS</PARTYLEDGERNAME>
<BASICBASEPARTYNAME>A.R.AUTO PARTS</BASICBASEPARTYNAME>
<FBTPAYMENTTYPE>Default</FBTPAYMENTTYPE>
<PERSISTEDVIEW>Invoice Voucher View</PERSISTEDVIEW>
<BASICBUYERNAME></BASICBUYERNAME>
<LEDGERENTRIES.LIST>
<OLDAUDITENTRYIDS.LIST TYPE="Number">
<OLDAUDITENTRYIDS>-1</OLDAUDITENTRYIDS>
</OLDAUDITENTRYIDS.LIST>
<LEDGERNAME>A.R.AUTO PARTS</LEDGERNAME>
<GSTCLASS/>
<ISDEEMEDPOSITIVE>Yes</ISDEEMEDPOSITIVE>
<LEDGERFROMITEM>No</LEDGERFROMITEM>
<REMOVEZEROENTRIES>No</REMOVEZEROENTRIES>
<ISPARTYLEDGER>Yes</ISPARTYLEDGER>
<ISLASTDEEMEDPOSITIVE>Yes</ISLASTDEEMEDPOSITIVE>
<AMOUNT>-3259.55</AMOUNT>
<BANKALLOCATIONS.LIST> </BANKALLOCATIONS.LIST>
<BILLALLOCATIONS.LIST> </BILLALLOCATIONS.LIST>
<INTERESTCOLLECTION.LIST> </INTERESTCOLLECTION.LIST>
<OLDAUDITENTRIES.LIST> </OLDAUDITENTRIES.LIST>
<ACCOUNTAUDITENTRIES.LIST> </ACCOUNTAUDITENTRIES.LIST>
<AUDITENTRIES.LIST> </AUDITENTRIES.LIST>
<TAXBILLALLOCATIONS.LIST> </TAXBILLALLOCATIONS.LIST>
<TAXOBJECTALLOCATIONS.LIST> </TAXOBJECTALLOCATIONS.LIST>
<TDSEXPENSEALLOCATIONS.LIST> </TDSEXPENSEALLOCATIONS.LIST>
<VATSTATUTORYDETAILS.LIST> </VATSTATUTORYDETAILS.LIST>
<COSTTRACKALLOCATIONS.LIST> </COSTTRACKALLOCATIONS.LIST>
</LEDGERENTRIES.LIST>
<ALLINVENTORYENTRIES.LIST>
<STOCKITEMNAME>01-0\11332W STD</STOCKITEMNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<ISLASTDEEMEDPOSITIVE>No</ISLASTDEEMEDPOSITIVE>
<ISAUTONEGATE>No</ISAUTONEGATE>
<ISCUSTOMSCLEARANCE>No</ISCUSTOMSCLEARANCE>
<ISTRACKCOMPONENT>No</ISTRACKCOMPONENT>
<ISTRACKPRODUCTION>No</ISTRACKPRODUCTION>
<ISPRIMARYITEM>Yes</ISPRIMARYITEM>
<ISSCRAP>No</ISSCRAP>
<RATE>1100.05/Nos</RATE>
<AMOUNT>2200.10</AMOUNT>
<ACTUALQTY>2 Nos</ACTUALQTY>
<BILLEDQTY>2 Nos</BILLEDQTY>
<BATCHALLOCATIONS.LIST>
<BATCHNAME>Primary Batch</BATCHNAME>
<INDENTNO/>
<ORDERNO>5</ORDERNO>
<TRACKINGNUMBER/>
<DYNAMICCSTISCLEARED>No</DYNAMICCSTISCLEARED>
<AMOUNT>2200.10</AMOUNT>
<ACTUALQTY> 2 Nos.</ACTUALQTY>
<BILLEDQTY> 2 Nos.</BILLEDQTY>
<ORDERDUEDATE>27-Oct-2015</ORDERDUEDATE>
<ADDITIONALDETAILS.LIST> </ADDITIONALDETAILS.LIST>
<VOUCHERCOMPONENTLIST.LIST> </VOUCHERCOMPONENTLIST.LIST>
<UDF:SHIPPEDBY.LIST DESC="`Shipped By``SpeedProduct``ItemPriceLevel`" ISLIST="YES" TYPE="String" INDEX="1">
<UDF:SHIPPEDBY DESC="`Shipped By``SpeedProduct``ItemPriceLevel`">RETAIL</UDF:SHIPPEDBY>
</UDF:SHIPPEDBY.LIST>
</BATCHALLOCATIONS.LIST>
<ACCOUNTINGALLOCATIONS.LIST>
<LEDGERNAME>CAM SHAFTS SALES</LEDGERNAME>
<GSTCLASS/>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<LEDGERFROMITEM>No</LEDGERFROMITEM>
<REMOVEZEROENTRIES>No</REMOVEZEROENTRIES>
<ISPARTYLEDGER>No</ISPARTYLEDGER>
<ISLASTDEEMEDPOSITIVE>No</ISLASTDEEMEDPOSITIVE>
<AMOUNT>2847.77</AMOUNT>
</ACCOUNTINGALLOCATIONS.LIST>
</ALLINVENTORYENTRIES.LIST>
<ALLINVENTORYENTRIES.LIST>
<STOCKITEMNAME>01-0\12170W</STOCKITEMNAME>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<ISLASTDEEMEDPOSITIVE>No</ISLASTDEEMEDPOSITIVE>
<ISAUTONEGATE>No</ISAUTONEGATE>
<ISCUSTOMSCLEARANCE>No</ISCUSTOMSCLEARANCE>
<ISTRACKCOMPONENT>No</ISTRACKCOMPONENT>
<ISTRACKPRODUCTION>No</ISTRACKPRODUCTION>
<ISPRIMARYITEM>No</ISPRIMARYITEM>
<ISSCRAP>No</ISSCRAP>
<RATE>646.67/Nos</RATE>
<AMOUNT>646.67</AMOUNT>
<ACTUALQTY>1 Nos</ACTUALQTY>
<BILLEDQTY>1 Nos</BILLEDQTY>
<BATCHALLOCATIONS.LIST>
<MFDON>#fromdate</MFDON>
<GODOWNNAME></GODOWNNAME>
<BATCHNAME></BATCHNAME>
<DESTINATIONGODOWNNAME></DESTINATIONGODOWNNAME>
<INDENTNO/>
<ORDERNO>4</ORDERNO>
<DYNAMICCSTISCLEARED>No</DYNAMICCSTISCLEARED>
<AMOUNT>646.67</AMOUNT>
<ACTUALQTY>1 Nos</ACTUALQTY>
<BILLEDQTY>1 Nos</BILLEDQTY>
<ORDERDUEDATE>2 Days</ORDERDUEDATE>
</BATCHALLOCATIONS.LIST>
<ACCOUNTINGALLOCATIONS.LIST>
<LEDGERNAME>CAM SHAFTS SALES</LEDGERNAME>
<GSTCLASS/>
<ISDEEMEDPOSITIVE>No</ISDEEMEDPOSITIVE>
<LEDGERFROMITEM>No</LEDGERFROMITEM>
<REMOVEZEROENTRIES>No</REMOVEZEROENTRIES>
<ISPARTYLEDGER>No</ISPARTYLEDGER>
<ISLASTDEEMEDPOSITIVE>No</ISLASTDEEMEDPOSITIVE>
<AMOUNT>646.67</AMOUNT>
</ACCOUNTINGALLOCATIONS.LIST>
</ALLINVENTORYENTRIES.LIST>
</VOUCHER>
</TALLYMESSAGE>
</REQUESTDATA>
</IMPORTDATA>
</BODY>
</ENVELOPE>
How to export employees List from tally using xml request
How to Integrate .NET with Tally Using XML
How to Enable TCS Calculation on Sale of Goods in Tally ERP 9
Tally XML stock summary request - Item Wise Stock Summary
How to export voucher from tally by using IDs - XML format